package com.cd2cd.code_template.controller;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.cd2cd.code_template.code_template.domain.SysUser;
import com.cd2cd.code_template.configuration.constants.ServiceCode;
import com.cd2cd.code_template.service.ConfigurationService;
import com.cd2cd.code_template.vo.BaseRes;
import com.cd2cd.code_template.vo.SysRouteVo;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

@Controller
@RequestMapping("configuration")
public class ConfigurationController {


    @Resource
    private ConfigurationService configurationService;

    @ResponseBody
    @RequestMapping(value = "getLoginUserInfo",method = RequestMethod.POST)
    public BaseRes<SysUser> getLoginUserInfo() {
        return configurationService.getLoginUserInfo();
    }


    @ResponseBody
    @RequestMapping(value = "getMenuList", method = RequestMethod.POST)
    public BaseRes<List<SysRouteVo>> getMenuList(String type) {
        return configurationService.getMenuList();
    }

}
